import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { promise } from 'protractor';
// import {HttpHeaders} from @angular/common/http;
@Injectable({
  providedIn: 'root'
})

export class CommonService {
  public domain: string = "http://10.100.185.117:4200";

  httpOptions = {
    headers: new HttpHeaders({
      'Content-Type': 'application/json;charset=UTF-8',
      'Access-Control-Allow-Origin': '*',
    })
  };
  constructor(public http: HttpClient) {

  }

  get(api) {
    return new Promise((resolve, reject) => {

      this.http.get(this.domain + api).subscribe((response) => {
        resolve(response);

      })

    })
  }
   
  post(){
    
  }



}
